package cn.project.lemontree.service.impl;

import cn.project.lemontree.bean.Parent_child_task;
import cn.project.lemontree.bean.Task;
import cn.project.lemontree.service.PcTaskService;
import cn.project.lemontree.dao.PcTaskDao;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class PcTaskServiceImpl extends ServiceImpl<PcTaskDao, Parent_child_task> implements PcTaskService {
    @Resource
    private PcTaskDao pcTaskDao;
    @Override
    public List<Parent_child_task> listpage(int page, int size, String childName, String theme) {
        return pcTaskDao.listpage((page-1)*size,size,childName,theme);
    }

    @Override
    public int count(String childName, String theme) {
        return pcTaskDao.count(childName,theme);
    }

    @Override
    public boolean savePCTask(Parent_child_task pCTask) {
        return pcTaskDao.save(pCTask)>0;
    }

    @Override
    public boolean updatePCTask(Parent_child_task pCTask) {
        return pcTaskDao.update(pCTask)>0;
    }

    @Override
    public List<Task> findAllByChild(Integer childId) {
        return pcTaskDao.findAllByChild(childId);
    }
}
